package org.lq.us.util;

import javax.sql.DataSource;

import org.apache.commons.dbcp2.BasicDataSourceFactory;
import org.apache.commons.dbutils.QueryRunner;
import org.lq.us.commons.ConfigConstant;

public class JDBCUtils {
	protected QueryRunner queryRunner = null;

	public JDBCUtils() {
		queryRunner = new QueryRunner(ds);
	}
	
	private static DataSource ds;
	static {
		
		try {
			ds = BasicDataSourceFactory.createDataSource(PropsUtil.loadProps(ConfigConstant.DBCP_FILE));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static DataSource getDataSource() {
		return ds;
	}

	
	
}
